package com.testing.splogin.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value="/hello",produces="application/json")
@Api(tags="欢迎类control",description = "第一个接口类")
public class HelloSpring {

    @ApiOperation(value="get请求hello",notes="请求可以通过输入url参数和?参数来进行输出")
   @GetMapping("/{teacher}")
   public String Hello(@PathVariable String teacher, @RequestParam String age){
       return "Hello Spring"+teacher+"年龄:"+age;
   }

    @ApiOperation("post请求hello")
    @PostMapping
    public String helloPost(@ApiParam(name="姓名",value="姓名") @RequestParam String username,String password){
        return "用户名是"+username+"密码是"+password;
    }
}
